package nc.bs.er.itemconfig;

import java.util.Vector;

import nc.vo.ep.dj.DJZBVO;
import nc.vo.er.exception.ExceptionHandler;
import nc.vo.pub.BusinessException;

public class DJZBBO {

	public DJZBVO beforeDelInf(nc.vo.arap.global.BusiTransVO[] busitransvos, DJZBVO dJZB) throws BusinessException {

		if (busitransvos != null) {
			for (int i = 0; i < busitransvos.length; i++) {
				try {
					((nc.bs.arap.outer.ArapPubDelInterface) busitransvos[i].getInfClass()).beforeDelAct(dJZB);
				} catch (ClassNotFoundException e) {
					ExceptionHandler.consume(e);
				} catch (Exception e) {
					ExceptionHandler.consume(e);
					String strerr = busitransvos[i].getUsesystemname() + busitransvos[i].getNote() + "\n" + e.getMessage();
					throw ExceptionHandler.createException(strerr, e);

				}
			}
		}
		return dJZB;
	}

	public DJZBVO afterDelInf(nc.vo.arap.global.BusiTransVO[] busitransvos, DJZBVO dJZB) throws BusinessException {

		if (busitransvos != null) {
			for (int i = 0; i < busitransvos.length; i++) {
				try {
					((nc.bs.arap.outer.ArapPubDelInterface) busitransvos[i].getInfClass()).afterDelAct(dJZB);
				} catch (ClassNotFoundException e) {
					ExceptionHandler.consume(e);
				} catch (Exception e) {
					ExceptionHandler.consume(e);
					String strerr = busitransvos[i].getUsesystemname() + busitransvos[i].getNote() + "\n" + e.getMessage();
					throw ExceptionHandler.createException(strerr, e);

				}
			}
		}
		return dJZB;
	}
	
	public DJZBVO[] findByPrimaryKeys_SS(Vector key) throws BusinessException {

		DJZBVO[] dJZB = null;

		String[] keys=new String[key.size()];
		key.copyInto(keys);

		try {
			DJZBDAO dmo = new DJZBDAO();
			dJZB = dmo.findDjByPrimaryKeys_SS(keys);
		}
		catch (Exception e) {
			throw ExceptionHandler.handleException(this.getClass(), e);
		}
		return dJZB;
	}
}
